
$(function(){
	checktoken();
}); 


checktoken = function(){
	cb = function(data){		
		if(data.code==1){
			$("#email").val(data.data.email);
		}else{
			$(".msg").text(data.message);
			$("#updataPWDpage").hide();
		}
	}
	var token = getUrlParam("token");
	var json ={url:site.web+site.module+"/validate",token:token};
	
	G(json,cb);
}

function tijiao(){
	var json = {password:"",email:"",url:""};	
	var password = $("#npwd").val();
	var repassword = $("#rnpwd").val();
	var token = getUrlParam("token");
	//获取页面url参数
	getUrlParam(name);
	if(password!==repassword){
		$(".msg").text("密码不一致!");
	}else{
			
		 	json.url = site.web+"forget/save";
		 	json.password = password;
		 	json.token = token;	
		 	
			//alertjson(json);
			
			
			cb = function(data){
				var msg = data.message;
				var code = data.code;
				if(code == 1){
					$(".msg").text("成功修改密码!!3秒后转到登录页面.");
					$("#tiJiaoButton").hide();
					
					gg = function(){
						
						window.location = "http://localhost/lnsysu/"
					}
					setTimeout("gg()",3000)
				}
				//$("#datamessage").after(msg);
			};
			G(json,cb);
			}
}